package com.wego.service.impl;

import com.github.pagehelper.Page;
import com.wego.common.base.impl.BaseServiceImpl;
import com.wego.common.bean.PageBean;
import com.wego.entity.domain.Carousel;
import com.wego.entity.query.CarouselQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wego.mapper.CarouselMapper;
import com.wego.service.CarouselService;
@Service
public class CarouselServiceImpl extends BaseServiceImpl<Carousel> implements CarouselService{

    @Autowired
    private CarouselMapper carouselMapper;

    @Override
    public PageBean<Carousel> selectPage(CarouselQuery carouselQuery) {
        //设置分页信息
        Page<Carousel> page = carouselQuery.toPage();
        //查询数据
        carouselMapper.selectList(carouselQuery);
        //将MyBatis提供的Page对象转换成我们自己的PageBean对象
        return new PageBean<>(page);
    }


}
